﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Data;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

using EditorialAdministration;
using AutomationAdmin.ViewModels;

namespace AutomationAdmin.Views
{
    public partial class UpcomingAutomationsPage : Page
    {
        public UpcomingAutomationsPage()
        {
            InitializeComponent();
            CollectionViewSource a = new CollectionViewSource();
            a.Source = App.CurrentAppState.Requests;
            a.Filter += new FilterEventHandler(delegate(object sender, FilterEventArgs args)
                {
                    NewAppRequest item = args.Item as NewAppRequest;
                    if (item != null && item.LastUpdate != null)
                    {
                        args.Accepted = (item.LastUpdate.Status == NewAppRequest.ReqStatus.InProgress);
                    }
                });
            this.DataContext = a;
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

    }
}
